package com.choudou5.solr.dataimport.config;

import cn.hutool.core.util.NumberUtil;
import com.choudou5.solr.util.StrUtil;

/**
 * @author choudou5
 * @create 2017-08-下午 6:33
 **/
public class DIEntity {

    private String name;
    private String indexName;
    private String dbGroup;
    private int batchSize = 1000;
    private boolean startup = false;
    private DIQueryPlugin queryPlugin;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIndexName() {
        return indexName;
    }

    public void setIndexName(String indexName) {
        this.indexName = indexName;
    }

    public String getDbGroup() {
        return dbGroup;
    }

    public void setDbGroup(String dbGroup) {
        this.dbGroup = dbGroup;
    }

    public int getBatchSize() {
        return batchSize;
    }

    public void setBatchSize(String batchSize) {
        if(StrUtil.isNotBlank(batchSize) && NumberUtil.isInteger(batchSize)){
            this.batchSize = Integer.parseInt(batchSize);
        }
    }

    public boolean getStartup() {
        return startup;
    }

    public void setStartup(String startup) {
        if(StrUtil.isNotBlank(startup)){
            this.startup = Boolean.valueOf(startup);
        }
    }


    public DIQueryPlugin getQueryPlugin() {
        return queryPlugin;
    }

    public void setQueryPlugin(DIQueryPlugin queryPlugin) {
        this.queryPlugin = queryPlugin;
    }

}
